﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AnguaRPGEngine.Library.Systems;

namespace AnguaRPGEngine.DND4eModule.Forms
{
    public partial class QuestEditor : Form
    {
        public QuestEditor()
        {
            InitializeComponent();
            btnSave.Enabled = false;
            cboQuestType.Items.Add("Minor");
            cboQuestType.Items.Add("Major");
        }
        public Quest Quest
        {
            get
            {
                Quest q = new Quest();
                q.Description = txtQuestDescription.Text;
                q.ExperiencePoints = (int)nudQuestXP.Value;
                q.Name = txtQuestName.Text;
                q.QuestType = (QuestTypes)cboQuestType.SelectedIndex;
                return q;
            }
            set
            {
                this.Text = "Edit Quest";
                txtQuestName.Text = value.Name;
                txtQuestDescription.Text = value.Description;
                nudQuestXP.Value = value.ExperiencePoints;
                cboQuestType.SelectedIndex = (int)value.QuestType;
            }
        }

        private void txtQuestName_TextChanged(object sender, EventArgs e)
        {
            btnSave.Enabled = (txtQuestName.Text.Length > 0);
        }
    }
}
